{include file="public/header" /}
<!-- 上传单图片头部 -->
{include file="public/upload_file_head" /}
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>添加</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t" name="preserve" id="preserve" method="post" action="add">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">商品分类：</label>
                            <div class="input-group col-sm-4">
                                <select class="form-control m-b chosen-select" name="mid" id="mid" required="">
                                    <option>请选择商品分类</option>
                                    {if !empty($mold)}
                                        {foreach name="mold" item="vo"}
                                            <option value="{$vo.id}">{$vo.lefthtml}{$vo.title}</option>
                                        {/foreach}
                                    {/if}
                                </select>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">名称：</label>
                            <div class="input-group col-sm-4">
                                <input id="title" type="text" class="form-control" name="title" placeholder="请输入名称" required="">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">原价：</label>
                            <div class="input-group col-sm-4">
                                <input id="title" type="text" class="form-control" name="price" placeholder="" required="">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">优惠价：</label>
                            <div class="input-group col-sm-4">
                                <input id="title" type="text" class="form-control" name="discount" placeholder="" required="">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">封面：</label>
                            <div class="input-group col-sm-4">
                                <input type="hidden" id="data_photo" name="cover">
                                <div id="fileList" class="uploader-list" style="float:right"></div>
                                <div id="imgPicker" style="float:left">选择图片</div>
                                <img id="img_data" height="100px" style="float:left;margin-left: 50px;margin-top: -10px;" src="__STATIC__/admin/images/no_img.jpg"/>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">图片集：</label>
                            <div class="input-group col-sm-4" id="banner-div">
                                <input class="banner-file" name="banner" id="image" type="hidden" />
                                <div class="maincontent clearfix">
                                    <div id="uploader-demo">
                                        <!--用来存放item-->
                                        <div id="thelist" style="width:512px;margin-left: 110px;" class="uploader-list"></div>
                                        <div>
                                            <div id="filePicker" class="btn btn-primary banner-sc" style="padding: 0; background: none !important;border: none !important">选择图片</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">描述：</label>
                            <div class="input-group col-sm-4">
                                <textarea name="describe" class="form-control" rows="3"></textarea>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">内容：</label>
                            <div class="input-group col-sm-7">
                                <script src="__STATIC__/admin/ueditor/ueditor.config.js" type="text/javascript"></script>
                                <script src="__STATIC__/admin/ueditor/ueditor.all.js" type="text/javascript"></script>
                                <textarea name="details" id="myEditor"></textarea>
                                <script type="text/javascript">
                                    var editor = new UE.ui.Editor();
                                    editor.render("myEditor");
                                </script>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">状态：</label>
                            <div class="col-sm-6">
                                <div class="radio i-checks">
                                    <input type="radio" name='status' value="1" checked="checked"/>开启&nbsp;&nbsp;
                                    <input type="radio" name='status' value="0" />关闭
                                </div>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">推荐：</label>
                            <div class="col-sm-6">
                                <div class="radio i-checks">
                                    <input type="radio" name='recommend' value="1" />是&nbsp;&nbsp;
                                    <input type="radio" name='recommend' value="0" checked="checked"/>否
                                </div>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">排序：</label>
                            <div class="input-group col-sm-1">
                                <input id="sort" type="text" value="10" class="form-control" name="sort" >
                            </div>
                        </div>

                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-3">
                                <button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> 保存信息</button>&nbsp;&nbsp;&nbsp;
                                <a class="btn btn-danger" href="javascript:history.go(-1);"><i class="fa fa-close"></i> 返回</a>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<!-- 上传单图片低部 -->
{include file="public/upload_file_footer" /}

<!-- 提交后的操作 -->
{include file="public/submit" /}

</body>
</html>
<!-- 上传图片初始化 -->
<script type="text/javascript">
    $(function(){
        // 单图片上传
        upload_file('fileList','imgPicker','data_photo','img_data');
    });
</script>